cssanimation: Fix animation-direction handling
authorBenjamin Otte <otte@redhat.com>
Mon, 7 Jul 2014 18:04:34 +0000 (20:04 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 7 Jul 2014 18:06:40 +0000 (20:06 +0200)
"alternate" was behaving as "alternate-reverse" and vice versa.

gtk/gtkcssanimation.c

index ef5e79abad6fbf6a667151f088f80673e9b96c03..df2e6097f09a3d8b028a7e5e20bc7665bd68fd47 100644 (file)
@@ -87,15 +87,15 @@ gtk_css_animation_get_progress_from_iteration (GtkCssAnimation *animation,
     case GTK_CSS_DIRECTION_ALTERNATE:
       d = floor (iteration);
       if (fmod (d, 2))
-        return iteration - d;
-      else
         return 1 + d - iteration;
+      else
+        return iteration - d;
     case GTK_CSS_DIRECTION_ALTERNATE_REVERSE:
       d = floor (iteration);
       if (fmod (d, 2))
-        return 1 + d - iteration;
-      else
         return iteration - d;
+      else
+        return 1 + d - iteration;
     default:
       g_return_val_if_reached (0);
     }